package com.zzxy.mvc.controller;

import com.zzxy.mvc.po.User;
import org.springframework.stereotype.Controller;
import com.zzxy.mvc.ext.UserExt;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/user")
public class UserAnnoController {

    @RequestMapping("/list.do")
    public String list(Model model) {
        model.addAttribute("username", "zhangwuji");
        return "user/userList";
    }


    @RequestMapping("/register.do")
    public String addUser(String username, String password, String sex) {
        System.out.println("用户名: " + username);
        System.out.println("密码: " + password);
        System.out.println("性别: " + sex);
        return "user/userList";
    }

    @RequestMapping("/register2.do")
    public String register2(User user) {
        System.out.println(user);
        return "user/userList";
    }
    @RequestMapping("/register3.do")
    public String addUser(UserExt ext, Model model) {
        model.addAttribute("userext", ext);
        System.out.println(ext);
        return "user/userList";
    }

}